<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>使用ng-if、ng-show、ng-disables、ng-init实现网站注册协议设置</title>
		<script src="../org/angular.min.js"></script>
	</head>
	<body>
	    <div ng-app="hd" ng-controller="ctrl">
	    	<input type="checkbox" ng-model="name" />
	    	<!--通过css隐藏-->
	    	<div ng-show="name">显示</div>  
	    	<!--DOM节点真正移除-->
	    	<!--<div ng-if="name">我要显示</div>  -->
	    	
	    	<label><input type="checkbox" ng-model="status" />接受此协议</label>   <!--点击按钮时status才会有值-->
	    	<button ng-init="allow=false" ng-click="allow=!allow">《xxxxx协议》</button>
	    	<textarea ng-show="allow">这里是协议内容，这里是协议内容</textarea>
	    	<!--ng-disabled为true时，表单字段禁用-->
	    	<input type="submit" ng-disabled="!status" value="登录" />   
	    </div>
	    <script>
	    	var m = angular.module('hd',[]);
	    	m.controller('ctrl',['$scope',function($scope){
	    		$scope.name="true"; 
	    	}])
	    </script>
	</body> 
</html>
